#!/usr/bin/node
const log = console.log;
//打印CPU架构信息及操作系统版本信息
log(`architecture:${process.arch}`);
log(`platform    ${process.platform}\n`);

//打印进程id信息以及node.js可执行文件的绝对路径信息
log(`process id:  ${process.pid}`);
log(`exePath    ${process.execPatn}\n`);
//打印Node.js版本信息
log(`nodejs version:${process.version}`);
//当前登录用户id信息
log(`user id:     ${process.getuid()}`);
//当前登录用户所属id组信息
log(`group id:     ${process.getgid()}`);
//当前脚本所在路径信息
log(`cwd:     ${process.cwd()}\n`);

//打印内存使用情况
log(`rss:  ${process.memoryUsage().rss}`);//查看系统的常驻内存大小
log(`heapTotal: ${process.memoryUsage().heapTotal}`);//查看动态分配的总内存大小
log(`heapUsed:  ${process.memoryUsage().heapUsed}`);//查看动态分配的已用内存大小
log(`external:  ${process.memoryUsage().external}`);//查看管理的绑定JS对象上的C++对象的内存

//打印环境变量
log("env:");
log(process.env);
